#include<bits/stdc++.h>
using namespace std;
signed main() {
	int t;
	scanf("%d", &t);
	while (t--) {
		char *str;
		str = (char*)malloc(1000);
		scanf("%s", str);

		int a, b, c;
		a = b = c = 0;

		int i;
		for (i = 0; str[i] != '+'; i++)
			a = a * 10 + (str[i] - '0');
		for (i = i + 1; str[i] != '='; i++)
			b = b * 10 + (str[i] - '0');
		for (i = i + 1; str[i] != '\0'; i++)
			c = c * 10 + (str[i] - '0');

		if (a + b == c)
			cout << "Right!\n";
		else
			cout << "Wrong!\n";

		free(str);
	}
	return 0;
}
